package com.sina.weibo;

import android.os.AsyncTask;
import android.widget.TextView;
import com.sina.weibo.models.User;
import sudroid.android.CleanUtils;

final class PostContentHelper
{
  private EditActivity activity;
  private boolean isLocated;
  private double mLat = -1.0D;
  private double mLon = -1.0D;
  private String picfilePath;
  private String postMsg;
  private AsyncTask<Void, Void, Boolean> postTask;
  private Throwable thr;
  private User user;

  PostContentHelper(EditActivity paramEditActivity)
  {
    this.activity = paramEditActivity;
  }

  static int getContentLength(String paramString)
  {
    int i = 0;
    int j = 0;
    int k = paramString.length();
    if (j >= k)
      return (int)Math.ceil(i / 2.0D);
    if ((char)paramString.codePointAt(j) > 'ÿ');
    for (int m = 2; ; m = 1)
    {
      i += m;
      j += 1;
      break;
    }
  }

  static String getExtraLengthString(String paramString, int paramInt)
  {
    String str1 = getTargetLengthString(paramString, paramInt);
    int i = paramString.length();
    int j = str1.length();
    if (i == j);
    int k;
    for (String str2 = ""; ; str2 = paramString.substring(k))
    {
      return str2;
      k = str1.length();
    }
  }

  static String getTargetLengthString(String paramString, int paramInt)
  {
    char[] arrayOfChar = paramString.toCharArray();
    int i = 0;
    int j = 0;
    int k = arrayOfChar.length;
    while (true)
    {
      if (i >= k)
      {
        String str1 = paramString;
        return str1;
      }
      if (arrayOfChar[i] > 'ÿ');
      int n;
      for (int m = 2; ; n = 1)
      {
        j += m;
        int i1 = paramInt * 2;
        if (j <= i1)
          break label74;
        String str2 = paramString.substring(0, i);
        break;
      }
      label74: i += 1;
    }
  }

  private void initParams()
  {
    this.postTask = null;
    this.user = null;
    this.postMsg = null;
    this.mLat = -1.0D;
    this.mLon = -1.0D;
    this.picfilePath = null;
    this.thr = null;
  }

  private void initPostCommentCommentTask()
  {
    initParams();
    PostContentHelper.3 local3 = new PostContentHelper.3(this);
    this.postTask = local3;
  }

  private void initPostForwardBlogTask()
  {
    initParams();
    PostContentHelper.2 local2 = new PostContentHelper.2(this);
    this.postTask = local2;
  }

  private void initPostNewBlogTask()
  {
    initParams();
    PostContentHelper.1 local1 = new PostContentHelper.1(this);
    this.postTask = local1;
  }

  private void initPostPrivateMsgTask()
  {
    initParams();
    PostContentHelper.5 local5 = new PostContentHelper.5(this);
    this.postTask = local5;
  }

  private void initPostSimpleCommentTask()
  {
    initParams();
    PostContentHelper.4 local4 = new PostContentHelper.4(this);
    this.postTask = local4;
  }

  boolean cancelTask()
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    for (boolean bool = this.postTask.cancel(1); ; bool = false)
      return bool;
  }

  void execCommentCommentTask(User paramUser)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostCommentCommentTask();
      this.user = paramUser;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execForwardBlogTask(User paramUser)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostForwardBlogTask();
      this.user = paramUser;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execPostNewBlogTask(User paramUser, String paramString)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostNewBlogTask();
      this.user = paramUser;
      this.postMsg = paramString;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execPostNewBlogTask(User paramUser, String paramString, double paramDouble1, double paramDouble2)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostNewBlogTask();
      this.user = paramUser;
      this.postMsg = paramString;
      this.mLat = paramDouble1;
      this.mLon = paramDouble2;
      this.isLocated = 1;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execPostNewBlogTask(User paramUser, String paramString1, String paramString2)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostNewBlogTask();
      this.user = paramUser;
      this.postMsg = paramString1;
      this.picfilePath = paramString2;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execPostNewBlogTask(User paramUser, String paramString1, String paramString2, double paramDouble1, double paramDouble2)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostNewBlogTask();
      this.user = paramUser;
      this.postMsg = paramString1;
      this.picfilePath = paramString2;
      this.mLat = paramDouble1;
      this.mLon = paramDouble2;
      this.isLocated = 1;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execPrivateMsgTask(User paramUser)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostPrivateMsgTask();
      this.user = paramUser;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  void execSimpleCommentTask(User paramUser)
  {
    if (!CleanUtils.isAsynctaskFinished(this.postTask));
    while (true)
    {
      return;
      initPostSimpleCommentTask();
      this.user = paramUser;
      AsyncTask localAsyncTask1 = this.postTask;
      Void[] arrayOfVoid = new Void[0];
      AsyncTask localAsyncTask2 = localAsyncTask1.execute(arrayOfVoid);
    }
  }

  int getCurrentTextLength()
  {
    try
    {
      int i = Integer.parseInt(this.activity.tvTextLimit.getText().toString().trim());
      j = i;
      return j;
    }
    catch (NumberFormatException localNumberFormatException)
    {
      while (true)
      {
        Utils.loge(localNumberFormatException);
        int j = -1;
      }
    }
  }

  boolean isTaskRunning()
  {
    if ((this.postTask != null) && (!CleanUtils.isAsynctaskFinished(this.postTask)));
    for (int i = 1; ; i = 0)
      return i;
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.PostContentHelper
 * JD-Core Version:    0.6.0
 */